﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<service_desk_blred.Models.ListaUsuarioModel>" %>

<asp:Content ID="registerTitle" ContentPlaceHolderID="TitleContent" runat="server">
    Gerenciar Usuários
</asp:Content>
<asp:Content ID="registerContent" ContentPlaceHolderID="MainContent" runat="server">
    <h3>
        Lista de Usuários</h3>

    <br />
    <div class="gridView" style="width: auto;">
        <table>
            <tr>
                <td>
                    Nome Fornecedor
                </td>
                <td>
                    Email
                </td>
                <td>
                    Login
                </td>
                <td>
                    Tipo de Usuário
                </td>
                <td>
                    Ramal
                </td>
                <td>
                    Ação
                </td>
            </tr>
            <% 
                foreach (var item in Model.usuarios)
                {  
            %>
            <tr>
                <td>
                    <%: item.NomeUsuario %>
                </td>
                <td>
                    <%: item.Email %>
                </td>
                <td>
                    <%: item.Login %>
                </td>
                <td>
                    <%: item.Grupo %>
                </td>
                <td>
                    <%: item.Ramal %>
                </td>
                <td>
                    <%: Html.ActionLink("Editar", "Editar", "Usuario", new { id = item.IdUsuario },null)%>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <%: Html.ActionLink("Excluir", "Excluir", "Usuario", new { id = item.IdUsuario }, null)%>
                </td>
            </tr>
            <% }

            %>
        </table>
    </div>
    <br />
    <p>
        <input type="button" class="button" value="Voltar" onclick="window.location.href='<%= Url.Action("Pesquisar", "Usuario") %>';" />
    </p>

</asp:Content>
